<%@page contentType="text/html" pageEncoding="UTF-8" session="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="contextPath" value="${pageContext.servletContext.contextPath}"/>
<html lang="nl">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Filialen van tot postcode</title>
        <link rel="stylesheet" type="text/css" 
              href="${contextPath}/styles/default.css"/>
    </head>
    <body>
        <div><a href="<c:url value='/'/>">Menu</a></div>
        <h1><fmt:message key="filialenVanTotPostcode"/></h1>
        <c:url value="/filialen" var="filialenURL"/>
        <form:form action="${filialenURL}" method="get" commandName="vantotpostcode">
            <form:label path="vanpostcode"><fmt:message key="van"/>:</form:label>
            <form:errors path="vanpostcode" cssClass="red"/>
            <form:input path="vanpostcode" size="4" maxlength="4"/>
            <form:label path="totpostcode"><fmt:message key="tot"/>:</form:label>
            <form:errors path="totpostcode" cssClass="red"/>
            <form:input path="totpostcode" size="4" maxlength="4"/>
            <input type="submit" value="<fmt:message key='zoeken'/>"/>
            <form:errors cssClass="red" element="div"/>
        </form:form>
        <c:forEach items="${filialen}" var="filiaal">
            <h2>${filiaal.naam}</h2>
            <p>${filiaal.adresToString}</p> 
        </c:forEach>
    </body>
</html>
